# -*- coding: utf-8 -*-

################################################################################
## Form generated from reading UI file 'fluid_settings.ui'
##
## Created by: Qt User Interface Compiler version 6.6.1
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
################################################################################

from PySide6.QtCore import (QCoreApplication, QMetaObject, QSize, Qt)
from PySide6.QtGui import (QFont, QIcon)
from PySide6.QtWidgets import (QFrame, QLabel,
                               QLineEdit, QPushButton, QVBoxLayout)
from . ClassUserInterface import LineEdit
from styles.styles_elements import QLineEdit_Error
from . import res_window_elem_rc


class Ui_Dialog(object):

    def setupUi(self, Dialog):
        if not Dialog.objectName():
            Dialog.setObjectName(u"Dialog")
        Dialog.resize(300, 440)
        Dialog.setStyleSheet(u"background-color: qlineargradient(spread:reflect, x1:0, y1:0, x2:1, y2:1, "
                             u"stop:0 rgba(80, 146, 158, 255), stop:1 rgba(19, 38, 125, 255));\n"
                             "font-family: Noto Sans SC;")
        self.verticalLayout_2 = QVBoxLayout(Dialog)
        self.verticalLayout_2.setObjectName(u"verticalLayout_2")
        self.frame = QFrame(Dialog)
        self.frame.setObjectName(u"frame")
        self.frame.setStyleSheet(u"background-color: rgba(255, 255, 255, 30); \n"
                                 "border: 1px solid rgba(255, 255, 255, 40);\n"
                                 "border-radius: 7px;")
        self.frame.setFrameShape(QFrame.StyledPanel)
        self.frame.setFrameShadow(QFrame.Raised)
        self.verticalLayout = QVBoxLayout(self.frame)
        self.verticalLayout.setObjectName(u"verticalLayout")
        self.FluidSettings = QLabel(self.frame)
        self.FluidSettings.setObjectName(u"FluidSettings")
        self.FluidSettings.setMaximumSize(QSize(16777215, 80))
        self.FluidSettings.setStyleSheet(u"color: white;\n"
                                         "font-weight: bold;\n"
                                         "font-size: 16pt;\n"
                                         "background-color: none;\n"
                                         "border: none")
        self.FluidSettings.setAlignment(Qt.AlignCenter)

        self.verticalLayout.addWidget(self.FluidSettings)

        self.name = LineEdit(self.frame)
        self.name.setObjectName(u"name")
        self.name.setStyleSheet(u"font-size: 12pt;\n"
                                "color: white;\n"
                                "padding-left: 10px;")

        self.verticalLayout.addWidget(self.name)

        self.density = LineEdit(self.frame)
        self.density.setObjectName(u"density")
        self.density.setStyleSheet(u"font-size: 12pt;\n"
                                   "color: white;\n"
                                   "padding-left: 10px;")

        self.verticalLayout.addWidget(self.density)

        self.dynamic_viscosity = LineEdit(self.frame)
        self.dynamic_viscosity.setObjectName(u"dynamic_viscosity")
        self.dynamic_viscosity.setStyleSheet(u"font-size: 12pt;\n"
                                             "color: white;\n"
                                             "padding-left: 10px;")

        self.verticalLayout.addWidget(self.dynamic_viscosity)

        self.mass_flow = LineEdit(self.frame)
        self.mass_flow.setObjectName(u"mass_flow")
        self.mass_flow.setStyleSheet(u"font-size: 12pt;\n"
                                     "color: white;\n"
                                     "padding-left: 10px;")

        self.verticalLayout.addWidget(self.mass_flow)

        self.btn_save_fluid = QPushButton(self.frame)
        self.btn_save_fluid.setObjectName(u"btn_save_fluid")
        font = QFont()
        font.setFamilies([u"Noto Sans SC"])
        font.setPointSize(12)
        self.btn_save_fluid.setFont(font)
        self.btn_save_fluid.setStyleSheet(u"QPushButton {\n"
                                          "color: white;\n"
                                          "background-color: rgba(255, 255, 255, 30);\n"
                                          "border: 1px solid rgba(255, 255, 255, 40);\n"
                                          "border-radius: 7px;\n"
                                          "width: 90px;\n"
                                          "height: 30px;\n"
                                          "}\n"
                                          "\n"
                                          "QPushButton:hover {\n"
                                          "background-color: rgba(255, 255, 255, 40);\n"
                                          "}\n"
                                          "\n"
                                          "QPushButton:pressed {\n"
                                          "background-color: rgba(255, 255, 255, 70);\n"
                                          "}")
        icon = QIcon()
        icon.addFile(u":/icons/icons/done_white_24dp.svg", QSize(), QIcon.Normal, QIcon.Off)
        self.btn_save_fluid.setIcon(icon)
        self.btn_save_fluid.setIconSize(QSize(24, 24))

        self.verticalLayout.addWidget(self.btn_save_fluid)

        self.verticalLayout_2.addWidget(self.frame)

        self.retranslateUi(Dialog)

        QMetaObject.connectSlotsByName(Dialog)

    # setupUi

    def retranslateUi(self, Dialog):
        Dialog.setWindowTitle(QCoreApplication.translate("Dialog", u"Dialog", None))
        self.FluidSettings.setText(QCoreApplication.translate("Dialog", u"Настройки жидкости", None))
        self.name.setText("")
        self.name.setPlaceholderText(QCoreApplication.translate("Dialog", u"Название", None))
        self.density.setText("")
        self.density.setPlaceholderText(QCoreApplication.translate("Dialog", u"Плотность [кг/м^3]", None))
        self.dynamic_viscosity.setText("")
        self.dynamic_viscosity.setPlaceholderText(
            QCoreApplication.translate("Dialog", u"Динамическая вязкость [мПа]", None))
        self.mass_flow.setText("")
        self.mass_flow.setPlaceholderText(QCoreApplication.translate("Dialog", u"Массовый расход [кг/с]", None))
        self.btn_save_fluid.setText(QCoreApplication.translate("Dialog", u"Сохранить", None))

    def get_property_fluid(self):
        return self.name.text(), self.mass_flow.text(), self.density.text(), self.dynamic_viscosity.text()

    def get_name_property_fluid(self):
        return self.name, self.mass_flow, self.density, self.dynamic_viscosity

    # def edit_error_string(self, name_string):
    #     if name_string.styleSheet() == "QLineEdit_Error":
    #         print('Хорошо')
